home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / dskutil / msort112.zip / SORTTAGS.BAT < prev    next >
DOS Batch File  |  1995-01-21  |  1KB  |  51 lines

  1. @echo off
  2. :: Sort Tag Line files and eliminate most duplicates.
  3. :: Copyright 1994 by Martin Katz, Ph.D. All rights reserved
  4.  
  5. :: This file is distributed as part of the MSORT package (version 1.0)
  6. :: and it serves as an example of how to use the program.
  7. echo off
  8.  
  9. if "%1" == "" goto NeedFile
  10. if "%1" == "%2" goto NeedFile
  11. if not exist %1 goto NeedFile
  12.  
  13. echo Sorting taglines from %1
  14. msort -# -c -t -u -b %1 -otags.srt
  15. if not errorlevel 1 goto SortOK
  16. echo.
  17. echo Error in sorting
  18. if exist tags.srt del tags.srt
  19. echo.
  20. echo Note: You may have to delete the temporary files.
  21. echo.
  22. goto Done
  23.  
  24. :SortOK
  25. if "%2" == "" goto UseDef
  26. if exist %2 del %2
  27. ren tags.srt %2
  28. @echo Sorted taglines from %1 are in %2
  29. goto Done
  30.  
  31. :UseDef
  32. if exist tags.old del tags.old
  33. ren %1 tags.old
  34. ren tags.srt %1
  35.  
  36. @echo Taglines in %1 are sorted -- The original file is in tags.old.
  37. goto Done
  38.  
  39. :NeedFile
  40. echo.
  41. echo    Please specify the tagline file to sort.
  42. echo Usage:
  43. echo    sorttags TagFile [SortedFile]
  44. echo Where
  45. echo    TagFile       is the file to be sorted
  46. echo    SortedFile    (optional) is the file name for the sorted result.
  47. echo                  If no SortedFile is specified, then TagFile is overwritten.
  48.  
  49. :Done
  50. set s=
  51.